package com.xjtu.project.controller.admin;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xjtu.project.common.utls.JsonResponse;
import com.xjtu.project.model.domain.Log;
import com.xjtu.project.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/admin")
public class LogController {
    @Autowired
    private LogService logService;
    @GetMapping("logs")
    public JsonResponse getLogs(Long page, Long size) {
        //直接查数据库返回
        Page<Log> logs = logService.getLogs(page,size);
        return JsonResponse.success(logs);
    }
}
